package com.yaowk.sfp.eoms.server.controller;

import com.yaowk.sfp.eoms.api.NotifyTargetApi;
import com.yaowk.sfp.eoms.api.model.NotifyTarget;
import com.yaowk.sfp.eoms.server.service.INotifyTargetService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class NotifyTargetController implements NotifyTargetApi {

    @Autowired
    private INotifyTargetService notifyTargetService;

    @Override
    public List<NotifyTarget> list() {
        return notifyTargetService.findAll();
    }

    @Override
    public NotifyTarget save(NotifyTarget notifyTarget) {
        return notifyTargetService.save(notifyTarget);
    }

    @Override
    public void delete(Long id) {
        notifyTargetService.deleteById(id);
    }
}
